<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../common/admin.asp"-->
<%
  '雅虎代拍
  set rshelp=server.CreateObject("adodb.recordset")
  sql="select id,jp_title from hot"
  rshelp.open sql,conn,1,3
  if not rshelp.eof then
  do while not rshelp.eof
	topurl="http://auctions.yahooapis.jp/AuctionWebService/V2/search"'正式接口
	postdatastr="appid="&yahoo_daigou_apiid&"&query="&server.urlencode(rshelp("jp_title"))&"&sort=bids&order=a"
	REST_RESPONSEhot = PostHttpPage(topurl, postdatastr)
	Set xml=Server.CreateObject("Microsoft.XMLDOM")
	xml.Async=False 
	xml.ValidateOnParse=False 
	xml.LoadXml(REST_RESPONSEhot) 
	'读取其他信息
	Set item=xml.getElementsByTagName("Item") 
	For a=0 To (item.Length-1) 
	'产品ID
	Set AuctionID=item.Item(a).getElementsByTagName("AuctionID")  
	set AuctionIDNode = item.Item(a).selectSingleNode("AuctionID")  
	if Not AuctionIDNode is Nothing Then AuctionID=AuctionID.Item(0).Text else AuctionID=""  
	'产品名称 
	Set Title=item.Item(a).getElementsByTagName("Title") 
	set TitleNode = item.Item(a).selectSingleNode("Title")  
	if Not TitleNode is Nothing Then Title=Title.Item(0).Text else Title=""  
	'产品图片 
	Set Image=item.Item(a).getElementsByTagName("Image") 
	set ImageNode = item.Item(a).selectSingleNode("Image")  
	if Not ImageNode is Nothing Then Image=Image.Item(0).Text else Image=""  
	'商品价格 
	Set CurrentPrice=item.Item(a).getElementsByTagName("CurrentPrice") 
	set CurrentPriceNode = item.Item(a).selectSingleNode("CurrentPrice")  
	if Not CurrentPriceNode is Nothing Then CurrentPrice=CurrentPrice.Item(0).Text else CurrentPrice=""
	  set rsx=server.createobject("adodb.recordset")
	  sql="select * from HotProduct"
	  rsx.open sql,conn,1,3
	  rsx.addnew
	  rsx("title")=title
	  rsx("type")=rshelp("id")
	  rsx("AuctionID")=AuctionID
	  rsx("pic")=Image
	  rsx("price")=CurrentPrice
	  rsx.update
	  rsx.close
	  set rsx=nothing
	next 
  rshelp.movenext
  loop
  rshelp.close
  set rshelp=nothing
  end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>main</title>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<style>body {background-color: #eaece1;}</style>
</head>

<body>
<div class="main">
<div class="main-title">
更新完成，请不要重复更新</div>
</div>
</body>
</html>
